package com.green.dao.manage.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.green.common.page.Pagination;
import com.green.dao.impl.BaseDaoImpl;
import com.green.dao.manage.ErpPackageDao;
import com.green.model.manage.ErpPackage;



/**
 * 地址基础数据
 * 
 */
@Repository("erpPackageDao")
public class ErpPackageDaoImpl extends BaseDaoImpl implements ErpPackageDao {

	@Override
	public int insertErpPackage(ErpPackage ct) {
		return insert("com.green.dao.manage.ErpPackageDao.insertErpPackage", ct);
	}

	@Override
	public int updateErpPackage(ErpPackage ct) {
		return update("com.green.dao.manage.ErpPackageDao.updateErpPackage", ct);
	}

	@Override
	public int deleteErpPackage(Map<String, Object> param) {
		return delete("com.green.dao.manage.ErpPackageDao.deleteErpPackage", param);
	}

	@Override
	public ErpPackage getErpPackageById(String id) {
		return (ErpPackage) super.getSqlSession().selectOne("com.green.dao.manage.ErpPackageDao.getErpPackageById",id);	
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<ErpPackage> getErpPackageList(Map<String, Object> param) {
		return (List<ErpPackage>) selectList("com.green.dao.manage.ErpPackageDao.getErpPackageList", param);
	}

	@Override
	public Pagination<ErpPackage> getErpPackagePagination(
			Pagination<ErpPackage> pag, Map<String, Object> param) {
		return  selectList("com.green.dao.manage.ErpPackageDao.getErpPackageList", param,pag);

	}
	
	
}
